package com.clz.appdesign.myapp.view;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;

/**
 * @author chenliangzhi
 * @date 2018/5/23
 * @describe
 */

public class BserView extends View {
    public BserView(Context context) {
        super(context);
    }

    public BserView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    public BserView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        Paint paint = new Paint();
        paint.setStyle(Paint.Style.STROKE);
        paint.setColor(Color.GREEN);
        paint.setStrokeWidth(8);
        Path path=new Path();
        path.moveTo(100,300);
        //二阶贝塞尔曲线
        path.quadTo(200,200,300,300);
        path.quadTo(400,400,500,300);
        canvas.drawPath(path,paint);
    }

}
